﻿
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Strive.Util.Text;
using Strive.Util.Logging;
using Strive.Core.Validations;
using Strive.Core.Service;
using Strive.Core.Translators;
using Strive.Util.Maths;
using Strive.Reflection;
using Strive.Aspects;

using Strive.DataAccess.Base.Model.PageObject;
using Strive.DataAccess.Base.BO;

using Strive.DataAccess.Base.Model.SearcherObject;

using OTA.Notification.DAO.Template;
using OTA.Notification.Entity.Template;

using OTA.Notification.Interface.IDAO.Template;
using OTA.Notification.Interface.IBO.Template;

using Strive.DataAccess;
using Strive.Util;

namespace OTA.Notification.BO.Template
{
    public abstract class MsgTemplateBO : BaseBOBean<string, MsgTemplateConfigBean, MsgTemplateConfigDao, IMsgTemplateConfigDao>, IMsgTemplateConfigBO
    {
        /// <summary>
        /// 方法名称: SaveBean
        /// 内容摘要: 增、删、改 实体MsgAdapterConfigBean
        /// </summary>
        /// <exception cref="BOExption ">业务异常</exception>
        /// <returns>SaveAction状态</returns>
        public virtual SaveAction SaveBean(MsgTemplateConfigBean obj)
        {
            try
            {
                return base.Save(obj);
            }
            catch (DAOException ex)
            {
                throw new BOExption("访问MsgTerminalBO时调用SaveBean方式错误", ex);
            }
        }

        /// <summary>
        /// 方法名称: SelectByPK
        /// 内容摘要: 由键值获取一个实体对象
        /// </summary>
        /// <exception cref="BOExption ">业务异常</exception>
        /// <returns>MsgAdapterConfig</returns>
        public virtual MsgTemplateConfigBean SelectByPK(string pk)
        {
            try
            {

                return base.Load(pk);
            }
            catch (DAOException ex)
            {
                throw new BOExption("访问MsgTerminalBO时调用SelectByPK方式错误", ex);
            }
        }

        public virtual MsgTemplateConfigBean SelectByPK(string pk1, string pk2) {
            try
            {

                return base.DomainDAO.DataSelect(pk1, pk2);
            }
            catch (DAOException ex)
            {
                throw new BOExption("访问MsgTerminalBO时调用SelectByPK方式错误", ex);
            }
        }


        public virtual PageResult<MsgTemplateConfigBean> SelectPageList(BasePageSearch search)
        {

            return base.DomainDAO.SelectPageList(search);

        }
    }
}
